package com.xncoding.rocketmq.Listener;

import com.xncoding.rocketmq.constant.RocketConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/***
* @description Canal的RocketMQ模式--接收canal发过来的数据库表数据变动记录
* @author luming
* @date 2021/4/24 17:05
* @throws
*/
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "ConsumerGroupCanal", topic = RocketConstant.TOPIC_CANAL,consumeMode= ConsumeMode.CONCURRENTLY)
public class CanalMessageListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        log.info("Received message:{}",message);
    }
}
